
******************************************************************************
***Relationship between Org Capital, SGA, Churn, and Advertising
******************************************************************************
use "C:\Users\mcsam\Dropbox\Decomposing Firm Betas\Submissions\JPE Macro\Replication Folder\\Figure_4_data",clear

binscatter sga_sale_ratio churn if ind1==5, xtitle(Customer Churn) ytitle(SG&A to Sales Ratio, size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export Output/Sales_Churn_Retail.png, height(600) width(900) replace
graph save 2.gph,replace

binscatter sga_sale_ratio churn if ind1!=5 , xtitle(Customer Churn, size(large)) ytitle(SG&A to Sales Ratio, size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export Output/Sales_Churn_NonRetail.png, height(600) width(900) replace
graph save 1.gph,replace


binscatter ok churn if ind1==5, xtitle(Customer Churn, size(large)) ytitle(Org Cap to Asset Ratio, size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export Output/OrgCap_Churn_Retail.png, height(600) width(900) replace
graph save 4.gph,replace

binscatter ok churn if ind1!=5 , xtitle(Customer Churn, size(large)) ytitle(Org Cap to Asset Ratio, size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export Output/OrgCap_Churn_NonRetail.png, height(600) width(900) replace
graph save 3.gph,replace

binscatter adv_sale_ratio churn if ind1==5, xtitle(Customer Churn, size(large)) ytitle(Advertising to Sales Ratio, size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export Output/Advertising_Churn_Retail.png, height(600) width(900) replace
graph save 6.gph,replace

binscatter adv_sale_ratio churn  if ind1!=5 , xtitle(Customer Churn, size(large)) ytitle(Advertising to Sales Ratio, size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export Output/Advertising_Churn_NonRetail.png, height(600) width(900) replace
graph save 5.gph,replace

graph combine 1.gph 2.gph 3.gph 4.gph 5.gph 6.gph, rows(3)
